package com.zjh.ai.controller;

import org.springframework.ai.chat.ChatClient;
import org.springframework.ai.openai.OpenAiChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

public class OpenController {

    @Autowired
    private OpenAiChatClient chatClient;

    @GetMapping("/top/code/language")
    public String topCodeLanguage() {
        String message = "2023最受欢迎编程语言是什么";
        return chatClient.call(message);
    }


}
